<?php

namespace App\Http\Controllers\Laravel\Event;

use App\Events\EventLab;
use App\Events\EvevtQueueLab;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Event;

class LabController extends Controller
{
    //
    public function main(){
        print '普通事件,立即触发';
        Event::fire(new EventLab('普通'));
        dd('end');
    }

    public function eventQueue(){
        print '队列';
        Event::fire(new EvevtQueueLab(123));
        //分发事件
        event(new EvevtQueueLab(234));
        dd('end');
    }

    public function eventHand(){
        print '手动注册';//TODO
    }
}
